/**
 * Generate time : 2011-06-01 16:37:34
 * Version : 1.0.1.V20070717
 */
package com.baosight.sczx.zm.cs.domain;

import com.baosight.iplat4j.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.ep.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.util.StringUtils;

/**
 * ZMCSEngineeringDesign table comment : T_CI_ENGINEERINGDESIGN
 */
public class ZMCSEngineeringDesign extends DaoEPBase {

	private String fdKeyId = " ";
	private String fdMineId = " "; /* 对应矿井ID */
	private String fdMineName = " "; /* 对应矿井名称 */
	private Long fdSerialNumber = new Long(0); /* 序号 */
	private String fdName = " "; /* 名称 */
	private String fdType = " "; /* 类型 */

	/**
	 * initialize the metadata
	 */
	public void initMetaData() {
		EiColumn eiColumn;

		eiColumn = new EiColumn("fdKeyId");
		eiColumn.setPrimaryKey(true);
		eiColumn.setFieldLength(32);
		eiColumn.setDescName(" ");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdMineId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("对应矿井ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdMineName");
		eiColumn.setFieldLength(20);
		eiColumn.setDescName("对应矿井名称");
		eiMetadata.addMeta(eiColumn);
		
		eiColumn = new EiColumn("fdSerialNumber");
		eiColumn.setType("N");
		eiColumn.setScaleLength(0);
		eiColumn.setFieldLength(38);
		eiColumn.setDescName("序号");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdName");
		eiColumn.setFieldLength(30);
		eiColumn.setDescName("名称");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdType");
		eiColumn.setFieldLength(1);
		eiColumn.setDescName("类型");
		eiMetadata.addMeta(eiColumn);

	}

	/**
	 * the constructor
	 */
	public ZMCSEngineeringDesign() {
		initMetaData();
	}

	/**
	 * get the fdKeyId
	 * 
	 * @return the fdKeyId
	 */
	public String getFdKeyId() {
		return this.fdKeyId;
	}

	/**
	 * set the fdKeyId
	 */
	public void setFdKeyId(String fdKeyId) {
		this.fdKeyId = fdKeyId;
	}

	/**
	 * get the fdMineId - 对应矿井ID
	 * 
	 * @return the fdMineId
	 */
	public String getFdMineId() {
		return this.fdMineId;
	}

	/**
	 * set the fdMineId - 对应矿井ID
	 */
	public void setFdMineId(String fdMineId) {
		this.fdMineId = fdMineId;
	}

	/**
	 * get the fdMineName - 对应矿井名称
	 * 
	 * @return the fdMineName
	 */
	public String getFdMineName() {
		return this.fdMineName;
	}

	/**
	 * set the fdMineName - 对应矿井名称
	 */
	public void setFdMineName(String fdMineName) {
		this.fdMineName = fdMineName;
	}
	
	/**
	 * get the fdSerialNumber - 序号
	 * 
	 * @return the fdSerialNumber
	 */
	public Long getFdSerialNumber() {
		return this.fdSerialNumber;
	}

	/**
	 * set the fdSerialNumber - 序号
	 */
	public void setFdSerialNumber(Long fdSerialNumber) {
		this.fdSerialNumber = fdSerialNumber;
	}

	/**
	 * get the fdName - 名称
	 * 
	 * @return the fdName
	 */
	public String getFdName() {
		return this.fdName;
	}

	/**
	 * set the fdName - 名称
	 */
	public void setFdName(String fdName) {
		this.fdName = fdName;
	}

	/**
	 * get the fdType - 类型
	 * 
	 * @return the fdType
	 */
	public String getFdType() {
		return this.fdType;
	}

	/**
	 * set the fdType - 类型
	 */
	public void setFdType(String fdType) {
		this.fdType = fdType;
	}

	/**
	 * get the value from Map
	 */
	@SuppressWarnings("rawtypes")
	public void fromMap(Map map) {

		setFdKeyId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdKeyId")), fdKeyId));
		setFdMineId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdMineId")), fdMineId));
		setFdMineName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdMineName")), fdMineName));
		setFdSerialNumber(NumberUtils.toLong(StringUtils.toString(map.get("fdSerialNumber")), fdSerialNumber));
		setFdName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdName")), fdName));
		setFdType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdType")), fdType));
	}

	/**
	 * set the value to Map
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map toMap() {

		Map map = new HashMap();
		map.put("fdKeyId", StringUtils.toString(fdKeyId, eiMetadata.getMeta("fdKeyId")));
		map.put("fdMineId", StringUtils.toString(fdMineId, eiMetadata.getMeta("fdMineId")));
		map.put("fdMineName", StringUtils.toString(fdMineName, eiMetadata.getMeta("fdMineName")));
		map.put("fdSerialNumber", StringUtils.toString(fdSerialNumber, eiMetadata.getMeta("fdSerialNumber")));
		map.put("fdName", StringUtils.toString(fdName, eiMetadata.getMeta("fdName")));
		map.put("fdType", StringUtils.toString(fdType, eiMetadata.getMeta("fdType")));

		return map;

	}
}